package com.czxy.demo02;

/**
 * Created by hp on 2020/2/21.
 */
public class Emp {
    private String name;
    private String id;
    private String deptid;
    private int salary;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Emp emp = (Emp) o;

        return id.equals(emp.id);
    }

    @Override
    public int hashCode() {
        return id.hashCode();
    }

    @Override
    public String toString() {
        return "Emp{" +
                "name='" + name + '\'' +
                ", id='" + id + '\'' +
                ", deptid='" + deptid + '\'' +
                ", salary=" + salary +
                '}';
    }

    public String getDeptid() {
        return deptid;
    }

    public void setDeptid(String deptid) {
        this.deptid = deptid;
    }

    public Emp(String name, String id, String deptid, int salary) {
        this.name = name;
        this.id = id;
        this.deptid = deptid;
        this.salary = salary;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public int getSalary() {
        return salary;
    }

    public void setSalary(int salary) {
        this.salary = salary;
    }

    public Emp() {

    }

    public Emp(String name, String id, int salary) {

        this.name = name;
        this.id = id;
        this.salary = salary;
    }
}
